<?php

/**

 * 分销商审核逻辑层

 * @author maniac

 */

namespace app\common\logic;

use app\common\model\Members;
use app\common\model\MembersDistribution AS MembersDistributionModel;

class MembersDistribution extends Base

{
    /**

     * 编辑

     * @param  array $data 请求的信息

     */

    public function save($data)

    {

        $result = parent::save($data);

        if ($result === true) {

            // 修改
            $uid = MembersDistributionModel::where('id',$data['id'])->value('userid');
            if($uid){
                Members::update(['id'=>$uid,'is_distribution'=>$data['status']]);
            }

        }

        return $result;

    }

}

